<template>
  <div class="chat-list-container">
    <div class="scrolling">
      <ul>
        <li class="chat-item" v-for="chat in chatList" @click="changeUserPanel(chat)">
          <div class="icon">
            <svg-icon :icon-class="chat.icon"/>
          </div>
          <div class="content">
            <div class="title">{{chat.title}}</div>
            <div class="last-chat">{{chat.lastMessage}}</div>
            <div class="last-update-date"></div>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
  export default {
    props: {
      chatList: {
        type: Array
      }
    },
    data() {
      return {
      }
    },
    mounted() {
    },
    methods: {
      changeUserPanel(chat) {
        this.$bus.$emit('change-user-panel', chat)
      }
    }
  }
</script>
